import com.qi.dao.TeacherMapper;
import com.qi.pojo.Teacher;
import com.qi.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

/**
 * @author zjq
 * @date 2020/3/11 15:46
 */
public class UserMapperText {
    @Test
    public void Teacher() {
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);
        Teacher teacher = mapper.getTeacher(1);
        System.out.println(teacher);
        /*
        Teacher(id=1, name=秦老师,
        students=[Student(id=1, name=小明, tid=1),
        Student(id=2, name=小红, tid=1),
        Student(id=3, name=小张, tid=1),
        Student(id=4, name=小李, tid=1),
        Student(id=5, name=小王, tid=1)])

         */
        sqlSession.close();
    }

}
